package com.atguigu.day17.work;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Random;

public class Work001 {
    public static void main(String[] args) {
        char[] arr = new char[26 + 26 + 10];

        for (int i = 0; i < arr.length; i++) {
            if (i < 10) {
                arr[i] = (char) (i + 48);
            } else if (i < 10 + 26) {
                arr[i] = (char) (i + 65 - 10);
            } else {
                arr[i] = (char) (i + 97 - 10 - 26);
            }
        }
        Collection<String> list = new ArrayList<String>();
        Random rand = new Random();
        for (int i = 0; i < 10; i++) {
            String str = "";
            for (int j = 0; j < 6; j++) {
                int index = rand.nextInt(arr.length);
                str += arr[index];
            }
            list.add(str);
        }
        Iterator<String> iter = list.iterator();
        while (iter.hasNext()) {
            System.out.println(iter.next());
        }
    }
}
